package com.ynding.cloud.common.exception;

import com.ynding.cloud.common.model.bo.IResponseCode;
import lombok.Getter;

/**
 *
 * @author ynding
 */
public enum SystemErrorType implements IResponseCode {

    SYSTEM_ERROR(-1, "系统异常"),
    SYSTEM_BUSY(1, "系统繁忙,请稍候再试"),

    GATEWAY_NOT_FOUND_SERVICE(404, "服务未找到"),
    GATEWAY_ERROR(500, "网关异常"),
    GATEWAY_CONNECT_TIME_OUT(010002, "网关超时"),

    ARGUMENT_NOT_VALID(020000, "请求参数校验不通过"),
    UPLOAD_FILE_SIZE_LIMIT(020001, "上传文件大小超过限制"),

    DUPLICATE_PRIMARY_KEY(030000,"唯一键冲突");

    /**
     * 错误类型码
     */
    private int code;
    /**
     * 错误类型描述信息
     */
    private String message;

    SystemErrorType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
